<template>
  <div>
    <div class="form">
      <div class="search">
        <el-date-picker
          value-format="yyyyMMdd"
          v-model="startTime"
          type="date"
          placeholder="开始时间"
        ></el-date-picker>
        <el-date-picker
          class="mar_left"
          value-format="yyyyMMdd"
          v-model="endTime"
          type="date"
          placeholder="结束时间"
        ></el-date-picker>
        <div class="pos_right_btn">
          <el-button @click="reset()">重置</el-button>
          <el-button type="primary" @click="getList(1)" class="searchBtn">搜索</el-button>
        </div>
      </div>
      <el-table
        class="listTable"
        ref="multipleTable"
        v-loading="listLoading"
        :data="list"
        border
        fit
        highlight-current-row
        style="width: 100%;"
      >
        <el-table-column label="企业名称" prop="id" width="100" align="center">
          <template slot-scope="{row}">
            <span>{{ row.companyName }}</span>
          </template>
        </el-table-column>
        <el-table-column label="需求产品名称" align="center">
          <template slot-scope="{row}">
            <span>{{ row.productName }}</span>
          </template>
        </el-table-column>
        <el-table-column label="需求状态" align="center">
          <template slot-scope="{row}">
            <span>{{ row.demandStatus }}</span>
          </template>
        </el-table-column>
        <el-table-column label="申请金额（元）" align="center">
          <template slot-scope="{row}">
            <span>{{ row.demandAmt }}</span>
          </template>
        </el-table-column>
        <el-table-column label="授信金额（元）" align="center">
          <template slot-scope="{row}">
            <span>{{ row.creditAmt }}</span>
          </template>
        </el-table-column>
        <el-table-column label="授信金融机构" align="center">
          <template slot-scope="{row}">
            <span>{{ row.creditFinanceOrg }}</span>
          </template>
        </el-table-column>
        <el-table-column label="放款金额（元）" align="center">
          <template slot-scope="{row}">
            <span>{{ row.loanAmt }}</span>
          </template>
        </el-table-column>
        <el-table-column label="放款金融机构" align="center">
          <template slot-scope="{row}">
            <span>{{ row.loanFinanceOrg }}</span>
          </template>
        </el-table-column>
        <el-table-column label="放款合同号" align="center">
          <template slot-scope="{row}">
            <span>{{ row.loanContractNo }}</span>
          </template>
        </el-table-column>
        <el-table-column label="最后登录时间" align="center">
          <template slot-scope="{row}">
            <span>{{ row.lastUpdateTime }}</span>
          </template>
        </el-table-column>
      </el-table>
      <div class="footer">
        <div></div>
        <el-pagination
          :total="total"
          layout="total, sizes, prev, pager, next"
          :page-size="limit"
          :page-sizes="[10, 20, 50, 100]"
          @size-change="handleSizeChange"
          ref="Pagination"
          :current-page.sync="curPage"
          @current-change="getList($event)"
          class="sortStyle"
        />
      </div>
    </div>
  </div>
</template>

<script>
import {
  financeList,
} from "@/api/system/user";
import { MessageBox } from "element-ui";
export default {
  components: {},
  data() {
    return {
      list: [],
      listLoading: false,
      total: 0,
      limit: 10,
      curPage: 0,
      startTime: '',
      endTime: '',
    };
  },
  created() {

  },
  mounted() {
    this.init();
  },
  methods: {
    init() {
      this.getList(1)
    },
    getList(page) {
      this.listLoading = true
      let params = {
        pageNum: page,
        pageSize: this.limit,
        startTime: this.startTime,
        endTime: this.endTime,
      }
      financeList(params).then(res => {
        this.listLoading = false
        if (res.code == '200') {
          this.list = res.rows
          this.total = res.total
        } else {
          this.$message({ message: res.msg, type: "error" });
        }
      });
    },
    handleSizeChange(val) {
      this.limit = val;
      this.getList(1);
    },
    reset() {
      this.startTime = ''
      this.endTime = ''
    }
  }
};
</script>
<style scoped>
.form {
  padding-left: 26px;
  padding-right: 24px;
  padding-top: 24px;
  background: #fff;
}
.search {
  display: flex;
  position: relative;
}
.search1 {
  display: flex;
}
.search_info {
  width: 120px;
  height: 40px;
  margin-right: 16px;
}
.search_info1 {
  width: 200px;
  height: 40px;
  margin-right: 16px;
}
.search_info2 {
  width: 140px;
  height: 40px;
  margin-right: 16px;
}
.searchBtn {
  margin-left: 16px;
  height: 36px;
}
.sortStyle {
  height: 19px;
  float: right;
  /* right: 24px; */
  margin-top: 20px;
  margin-bottom: 30px;
}
.pos_right_btn {
  position: absolute;
  right: 0;
}
.opt_font {
  cursor: pointer;
  color: #2e82ff;
}
.detail_title {
  font-size: 16px;
  font-weight: 400;
  color: #212121;
  line-height: 22px;
}
.detail_title span {
  padding-left: 4px;
  background: #1e88e5;
  margin-right: 12px;
}
.row {
  display: flex;
  /* padding-bottom: 12px; */
}
.detail_info {
  padding-top: 16px;
}
.info_left {
  display: flex;
}
.info_right {
  display: flex;
  /* padding-left: 202px; */
}
.info_left_title {
  font-size: 14px;
  font-weight: 400;
  color: #616161;
  line-height: 20px;
  width: 256px;
  /* margin-right: 16px; */
  text-align: center;
  min-height: 47px;
  background: #f5f7fa;
  box-shadow: inset 0 -1px 0 0 #dcdfe6;
}
.info_left_title .font {
  position: relative;
  top: 14px;
}
.info_left_content {
  font-size: 14px;
  font-weight: 400;
  color: #212121;
  line-height: 20px;
  width: 256px;
  /* border: 1px solid #DCDFE6; */
  box-shadow: inset -1px -1px 0 0 #dcdfe6;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  /* position: relative;
    top: 10px; */
}
.info_left_contents {
  font-size: 14px;
  font-weight: 400;
  color: #212121;
  line-height: 20px;
  width: 769px;
  /* border: 1px solid #DCDFE6; */
  box-shadow: inset -1px -1px 0 0 #dcdfe6;
  text-align: left;
}
.pos_top {
  padding-top: 12px;
}
.top_more {
  margin-top: 8px;
}
.detailTable {
  margin-top: 16px;
}
.opt_font {
  color: #1e88e5;
  cursor: pointer;
}
.page_pos {
  text-align: right;
  padding-top: 10px;
}
.backBtn {
  text-align: center;
  margin-top: 10px;
}
/deep/ .el-dialog {
  display: flex;
  flex-direction: column;
  margin: 0 !important;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-height: calc(100% -30px);
  /* max-width: ; */
}
/deep/ .el-dialog .el-dialog__body {
  flex: 1;
  height: 600px;
  overflow-y: auto;
  padding-top: 0;
}
.tab {
  display: flex;
  position: absolute;
  right: 55px;
  top: 14px;
}
.tab_border {
  border: 1px solid #409eff;
  color: #409eff;
  padding: 10px 12px;
  font-size: 14px;
  margin-right: 16px;
}
.change {
  border: 1px solid #f56c6c;
  color: #f56c6c;
}
.listTable {
  margin-top: 17px;
}
/deep/ .search_info .el-input__inner {
  width: 120px;
}
/deep/ .search_info1 .el-input__inner {
  width: 200px;
}
/deep/ .search_info2 .el-input__inner {
  width: 140px;
}
.date_picker /deep/ .el-input__inner {
  width: 240px;
}
.opt_table {
  display: flex;
  justify-content: space-around;
}
.footer {
  display: flex;
  justify-content: space-between;
}
.footer_btn {
  position: relative;
  top: 20px;
}
.opt_disable {
  color: #909399;
}
.mar_left {
  margin-left:20px;
}
</style>
